﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using Microsoft.Xna.Framework.Graphics;
using Microsoft.Xna.Framework;

namespace GalaxyPresident
{
    public abstract class CommonEntity : PlanetEntity
    {
        protected List<Texture2D> textures = new List<Texture2D>();

        public int Level
        {
            get { return level; }
            set
            {
                if (value < 0 || value >= textures.Count)
                    return; 
                level = value;
                sprite.Texture = textures[level];
            }
        }

        public CommonEntity(Planet planet)
            : base(planet)
        {
        }

        public void levelUp()
        {
            Level++;
            sprite.Texture = textures[level];
        }

        public void levelDown()
        {
            Level--;
            sprite.Texture = textures[level];
        }

        public override bool isCommonEntity()
        {
            return true;
        }

        public override string getObjectName()
        {
            return "CommonEntity";
        }

        protected override void updateSpriteSColor()
        {
            sprite_s.Color = Color.Black;
        }

        public override string getInfoString()
        {
            return @"Level     : " + (level + 1).ToString();
        }
    }
}
